ALMaSS  1.0
The Animal, Landscape and Man Simulation System
Goose_Base Class Reference

A class to describe the goose base. More...

#include <Goose_Base.h>

Inheritance diagram for Goose_Base:
TAnimal TALMaSSObject Goose_Barnacle_Base Goose_Greylag_Base Goose_Pinkfoot_Base Goose_Barnacle_FamilyGroup Goose_Barnacle_NonBreeder Goose_Greylag_FamilyGroup Goose_Greylag_NonBreeder Goose_Pinkfoot_FamilyGroup Goose_Pinkfoot_NonBreeder

Public Member Functions

 Goose_Base (Landscape *p_L, Goose_Population_Manager *p_NPM, double a_weight, bool a_sex, APoint a_roost)
 Goose_Base constructor. More...
 
void Init (Goose_Population_Manager *p_NPM, double a_weight, bool a_sex, APoint a_roost)
 Intitialise object. More...
 
void ReInit (Landscape *p_L, Goose_Population_Manager *p_NPM, double a_weight, bool a_sex, APoint a_roost)
 ReInit for object pool. More...
 
virtual ~Goose_Base ()
 Goose_Base destructor. More...
 
void st_Dying (void)
 Behavioural state dying. More...
 
void Explore ()
 Behavioural exploration of the area to find forage. More...
 
TTypeOfGoose_BaseState st_Forage ()
 Behavioural forage. More...
 
virtual TTypeOfGoose_BaseState st_ToRoost ()
 Return to roost and assess whether to forage again that day. More...
 
APoint GetRoost ()
 Supply roost coords. More...
 
TMaxIntakeSource GetMaxIntakeSource ()
 Supply the current max intake source. More...
 
virtual void ChangeRoost ()
 Find the closest roost. More...
 
TTypeOfGoose_BaseState st_Roost ()
 Roosting until next forage or next morning. More...
 
virtual APoint ChooseHopLoc ()
 Pick a hop location point within a_dist meters - must be overridden by descendent classes. More...
 
void EvaluateForageToHopLoc (APoint a_HopLoc)
 Do a forage evaluation from current location to a_HopLoc. More...
 
virtual void StartDay (void)
 Do any 'housekeeping' associated with the start of day. More...
 
virtual void BeginStep (void)
 The BeginStep is the first 'part' of the timestep that an animal can behave in. It is called once per timestep (10 minutes). More...
 
virtual void Step (void)
 The Step is the second 'part' of the timestep that an animal can behave in. It is called continuously until all animals report that they are 'DONE'. More...
 
virtual void EndStep (void)
 The EndStep is the third 'part' of the timestep that an animal can behave in. It is called once per timestep. More...
 
virtual void On_Emigrate ()
 Cause the bird to immediately transition to Emigrate. More...
 
double GetBodyCondition ()
 Returns the current body condition. More...
 
void SetBodyCondition (double a_condition, unsigned a_index)
 Sets the current body condition. More...
 
void AddBodyCondition (double a_condition)
 Alters body conditon by addition of a double value. More...
 
void SubtractBodyCondition (double a_condition)
 Alters body conditon by subtraction of a double value. More...
 
int GetGroupsize ()
 Returns the groupsize. More...
 
double ScaleForageToGroupsize (double a_forage)
 Scales forage to groupsize. More...
 
int GetForageLocIndex ()
 Gets for the forage location index. More...
 
GooseSpecies GetSpecies ()
 Returns the species. More...
 
bool GetSex ()
 Returns the sex. More...
 
int GetMaxAppetiteHitTime ()
 Returns m_DailyMaxAppetiteHitTime. More...
 
int GetFlightNumber ()
 Returns the total daily number of flights. More...
 
int GetFlightDistance ()
 Returns the total daily distance flown. More...
 
double GetDailyEnergyBudget ()
 Returns the daily energy budget. More...
 
double GetDailyEnergyExpenditure ()
 Returns the daily energy expenditure. More...
 
int GetForagingTime (int a_EndForagingTime, double a_RoostLeaveTime)
 Returns the time spent foraging. More...
 
double GetGooseMinForageRate (GooseSpecies a_species)
 Returns the minimum forage rate for the species. More...
 
double GetMaxForageRate (double a_grain, double a_maize, double a_grass, double a_interferenceComp, bool a_iscereal, TTypesOfVegetation a_veg, bool a_stubble, TTypesOfVegetation a_prevcrop)
 Returns the max forage rate of the three different types of forage The max rate is adjusted according to feeding time in the time budget, according to the interference competition value and to the current snow depth in the landscape. More...
 
double GetMaxIntakeRate (double a_grain, double a_maize, double a_grass)
 Returns the max intake rate of the three different types of intake. More...
 
void SetSex (bool a_sex)
 Sets the sex. More...
 
double GetTotalWeight ()
 Returns the weight of the bird. More...
 
double GetRoostLeaveTime ()
 Returns the time when the goose leaves the roost. More...
 
void SetFlightCost (double a_cost)
 Set the flight cost per m per g. More...
 
double GetFlightCost ()
 Get the flight costs per m per g. More...
 
void Set_mingooseforagerate (double a_cost, GooseSpecies a_species)
 Set the mimimum tolerated forage rate for all geese. More...
 
void Set_Indivmingooseforagerate (double a_cost)
 Set the mimimum tolerated forage rate for the individual goose. More...
 
void Set_GooseLeavingThreshold (double a_threshold)
 Set the body condition threshold for leaving for all geese. More...
 
void Set_GooseMaxAppetiteScaler (double a_cost)
 Set the goose appetite scale used to calculate max intake for all geese. More...
 
void Set_GooseMaxEnergyReserveProportion (double a_prop)
 Set the maximum energy reserve proportion allowed for all geese. More...
 
void Set_GooseKJtoFatConversion (double a_cost)
 Set the kJ to fat conversion constant for all geese. More...
 
void Set_GooseFattoKJConversion (double a_cost)
 Set the fat to kJ conversion constant for all geese. More...
 
void Set_GooseMinForageOpenness (double a_cost)
 Set the min forage openess for all geese. More...
 
void Set_GooseForageDist (double sp1, double sp2, double sp3)
 Set the max forage distance from roost for all geese. More...
 
void Set_GooseFieldForageDist (double sp1, double sp2, double sp3)
 Set the max forage distance from a field for all geese. More...
 
void Set_GooseFollowingLikelyhood (int a_likelyhood, GooseSpeciesType a_speciestype)
 Set the followinglikelyhood. More...
 
void Set_GooseLeavingRoost (bool a_leaving)
 Set the flag to indicate if we are coming from the roost. More...
 
void On_MoveTo (int a_x, int a_y)
 The goose is moved to the location specified by a_x, a_y - caused by group decision. More...
 
virtual void KillThis ()
 The bird is dead of some external cause. More...
 
void On_Bang (int a_polyid)
 The goose is scared by a bang at location. More...
 
void On_Bang (int a_polyid, double a_scare)
 The goose is scared by a bang at location. More...
 
void On_Migrate (TTypeOfLeaveReason a_leavereason)
 The goose is told to leave the simulation area (poss due to bad weather) More...
 
double AdjustIntakeRateToSnowDepth (double a_intakerate)
 When there is snow, the intake rate is decreased by 10 % per cm of snow. More...
 
- Public Member Functions inherited from TAnimal
unsigned SupplyFarmOwnerRef ()
 
AnimalPosition SupplyPosition ()
 
APoint SupplyPoint ()
 
int SupplyPolygonRef ()
 
int Supply_m_Location_x ()
 
int Supply_m_Location_y ()
 
virtual void CopyMyself ()
 
void SetX (int a_x)
 
void SetY (int a_y)
 
 TAnimal (int x, int y, Landscape *L)
 
virtual void ReinitialiseObject (int x, int y, Landscape *L)
 Used to re-use an object - must be implemented in descendent classes. More...
 
virtual int WhatState ()
 
virtual void Dying ()
 
void CheckManagement (void)
 
void CheckManagementXY (int x, int y)
 
virtual bool OnFarmEvent (FarmToDo)
 
- Public Member Functions inherited from TALMaSSObject
int GetCurrentStateNo ()
 Returns the current state number. More...
 
void SetCurrentStateNo (int a_num)
 Sets the current state number. More...
 
bool GetStepDone ()
 Returns the step done indicator flag. More...
 
void SetStepDone (bool a_bool)
 Sets the step done indicator flag. More...
 
virtual void ReinitialiseObject ()
 Used to re-use an object - must be implemented in descendent classes. More...
 
 TALMaSSObject ()
 The constructor for TALMaSSObject. More...
 
virtual ~TALMaSSObject ()
 The destructor for TALMaSSObject. More...
 
void OnArrayBoundsError ()
 Used for debugging only, tests basic object properties. More...
 

Protected Member Functions

TTypeOfGoose_BaseState st_ChooseForageLocation (void)
 Selects a forage location based on past memory, or initiates an exploration. More...
 
void FlyTo (int a_x, int a_y)
 The goose flys to the location specified by a_x, a_y. More...
 
void FlyTo (APoint a_pt)
 The goose flys to the location specified by a_pt. More...
 
- Protected Member Functions inherited from TAnimal
void CorrectWrapRound ()
 Corrects wrap around co-ordinate problems. More...
 

Protected Attributes

TTypeOfGoose_BaseState CurrentGState
 Variable to record current behavioural state. More...
 
Goose_Population_Managerm_OurPopulationManager
 This is a time saving pointer to the correct population manager object. More...
 
bool m_sex
 Sex of bird, true = male false = female. More...
 
GooseSpecies m_myspecies
 Holds goose species. More...
 
GooseSpeciesType m_myGooseSpeciesType
 Holds the goose species type. More...
 
APoint m_MyRoost
 The current roost location. More...
 
int m_groupsize
 The size of the group this bird represents. More...
 
double m_weight
 The weight of the bird in gram excluding fat reserve. More...
 
double m_weightTotal
 The weight of the bird in g including fat reserve. More...
 
int m_forageLocCount
 The number of forage locations visited today. More...
 
double m_BMR
 The daily BMR. More...
 
double m_DEB
 The daily energy budget excluding flying (kJ) More...
 
double m_DailyMaxAppetite
 The daily max kJ possible to get as intake. More...
 
int m_DailyMaxAppetiteHitTime
 The time of day when m_DailyMaxAppetite was hit. More...
 
double m_energyToday
 The bird's daily energy account (kJ) More...
 
TMaxIntakeSource m_MaxIntakeSource
 Holds information about the food source which gave max intake rate. More...
 
double m_LeaveRoostTime
 Controls the time when the goose will leave the roost. More...
 
bool m_LeavingRoost
 Flag to indicate that we are coming from the roost. Used to control code for "following". More...
 
double m_energyReserve
 The bird's energy reserves in grams. More...
 
double m_Indivmingooseforagerate
 The minimum tolerable forage rate in kJ/minute for the individual. More...
 
double m_BodyCondition [5]
 A variable describing current body condition over the past 5 days. More...
 
double m_TheBodyCondition
 A variable describing current body condition averaged over 5 days. More...
 
unsigned m_BodyConditionCounter
 A counter for the daily body condition. More...
 
int m_myForageIndex
 Temporary storage for a forage location index - this is a speed optimisation. More...
 
int m_myMemPolyID
 Temporary storage for a memory location polygon id. More...
 
GooseMemoryMapm_MyMemory
 The Goose Memory. More...
 
int m_FlightNumber
 Counter for the number of flights per day. More...
 
int m_FlightDistance
 Storage for the total distance flown per day. More...
 
- Protected Attributes inherited from TAnimal
int m_Location_x
 
int m_Location_y
 
Landscapem_OurLandscape
 
- Protected Attributes inherited from TALMaSSObject
int m_CurrentStateNo
 The basic state number for all objects - '-1' indicates death. More...
 
bool m_StepDone
 Indicates whether the iterative step code is done for this timestep. More...
 

Static Protected Attributes

static double m_SnowDepth = 0.0
 The current snow depth. Held here for speed optimization. More...
 
static double m_flightcost = -1
 The cost of flight per g per m in kJ. More...
 
static double m_mingooseforagerate [gs_foobar] = { -1, -1, -1 }
 The minimum tolerable forage rate in kJ/minute for the species. More...
 
static double m_GooseForageDist [gs_foobar] = { -1, -1, -1 }
 The maximum distance travelled from roost to forage sites for each species of goose (m) More...
 
static double m_GooseForageDistX2 [gs_foobar] = { -1, -1, -1 }
 Double the maximum distance travelled from roost to forage sites for each species of goose (m) - this is a speed optimisation. More...
 
static double m_GooseFieldForageDist [gs_foobar] = { -1, -1, -1 }
 The maximum distance travelled from roost to forage sites for each species of goose (m) More...
 
static double m_GooseFieldForageDistX2 [gs_foobar] = { -1, -1, -1 }
 Double the maximum distance travelled from roost to forage sites for each species of goose (m) - this is a speed optimisation. More...
 
static double m_GooseLeavingThreshold = -1
 The trigger for leaving as a 5 day average of body condition. More...
 
static double m_GooseMaxAppetiteScaler = -1
 Scaler to determine the max kJ possible to eat per day based on non-energy reserve weight. More...
 
static double m_GooseMaxEnergyReserveProportion = -1
 Max proportion of weight that can be energy reserve. More...
 
static double m_GooseKJtoFatConversion = -1
 Conversion rate kJ to fat. More...
 
static double m_GooseFattoKJConversion = -1
 Conversion rate fat to kJ. More...
 
static double m_GooseMinForageOpenness = -1
 The minimum openness value a goose will tolerate for forage. More...
 
static int m_followinglikelyhood [(int) gst_foobar] = { -1, -1, -1 , -1, -1, -1 }
 An attribute used to determine the chance of following or exploring when foraging. More...
 

Detailed Description

A class to describe the goose base.

Constructor & Destructor Documentation

◆ Goose_Base()

Goose_Base::Goose_Base ( Landscape p_L,
Goose_Population_Manager p_NPM,
double  a_weight,
bool  a_sex,
APoint  a_roost 
)

Goose_Base constructor.

163  : TAnimal(0, 0, p_L)
164 {
165  Init(p_NPM, a_weight, a_sex, a_roost);
166 }
void Init(Goose_Population_Manager *p_NPM, double a_weight, bool a_sex, APoint a_roost)
Intitialise object.
Definition: Goose_Base.cpp:111
TAnimal(int x, int y, Landscape *L)
Definition: PopulationManager.cpp:1367

References Init().

◆ ~Goose_Base()

Goose_Base::~Goose_Base ( void  )
virtual

Goose_Base destructor.

177 {
178  if (m_MyMemory!=NULL) delete m_MyMemory;
179 }
GooseMemoryMap * m_MyMemory
The Goose Memory.
Definition: Goose_Base.h:299

References m_MyMemory.

Member Function Documentation

◆ AddBodyCondition()

void Goose_Base::AddBodyCondition ( double  a_condition)
inline

Alters body conditon by addition of a double value.

402 { m_TheBodyCondition += a_condition; }
double m_TheBodyCondition
A variable describing current body condition averaged over 5 days.
Definition: Goose_Base.h:283

References m_TheBodyCondition.

Referenced by StartDay().

◆ AdjustIntakeRateToSnowDepth()

double Goose_Base::AdjustIntakeRateToSnowDepth ( double  a_intakerate)

When there is snow, the intake rate is decreased by 10 % per cm of snow.

730  {
731  if (m_SnowDepth > 0.0) {
732  a_intakerate = a_intakerate * (1 - (m_SnowDepth * cfg_goose_snow_scaler.value()));
733  }
734  return a_intakerate;
735 }
CfgFloat cfg_goose_snow_scaler
The decrease in intake rate resulting from snow.
double value(void)
Definition: configurator.h:118
static double m_SnowDepth
The current snow depth. Held here for speed optimization.
Definition: Goose_Base.h:199

References cfg_goose_snow_scaler, m_SnowDepth, and CfgFloat::value().

Referenced by GetMaxForageRate().

◆ BeginStep()

virtual void Goose_Base::BeginStep ( void  )
inlinevirtual

The BeginStep is the first 'part' of the timestep that an animal can behave in. It is called once per timestep (10 minutes).

Reimplemented from TAnimal.

375 { StartDay(); }
virtual void StartDay(void)
Do any 'housekeeping' associated with the start of day.
Definition: Goose_Base.cpp:181

References StartDay().

◆ ChangeRoost()

virtual void Goose_Base::ChangeRoost ( )
inlinevirtual

Find the closest roost.

Reimplemented in Goose_Pinkfoot_Base, Goose_Greylag_Base, and Goose_Barnacle_Base.

355 { ; }

◆ ChooseHopLoc()

virtual APoint Goose_Base::ChooseHopLoc ( )
inlinevirtual

Pick a hop location point within a_dist meters - must be overridden by descendent classes.

Reimplemented in Goose_Pinkfoot_Base, Goose_Greylag_Base, and Goose_Barnacle_Base.

363 { return m_MyRoost; }
APoint m_MyRoost
The current roost location.
Definition: Goose_Base.h:167

References m_MyRoost.

Referenced by Explore().

◆ EndStep()

virtual void Goose_Base::EndStep ( void  )
inlinevirtual

The EndStep is the third 'part' of the timestep that an animal can behave in. It is called once per timestep.

Reimplemented from TAnimal.

Reimplemented in Goose_Pinkfoot_FamilyGroup, Goose_Greylag_FamilyGroup, and Goose_Barnacle_FamilyGroup.

383 {} // NB this is not used in the Goose_Base code

◆ EvaluateForageToHopLoc()

void Goose_Base::EvaluateForageToHopLoc ( APoint  a_HopLoc)

Do a forage evaluation from current location to a_HopLoc.

Moves along the vector between the current location and a_HopLoc testing forage for each polygon encountered along the way. This will build up the goose' memory.

Parameters
[in]a_HopLocA point in the landscape.
594 {
595  double dx = a_HopLoc.m_x - m_Location_x;
596  double dy = a_HopLoc.m_y - m_Location_y;
597  int dist = g_AlmassMathFuncs.CalcDistPythagoras( a_HopLoc.m_x, a_HopLoc.m_y, m_Location_x, m_Location_y );
598  double tx = m_Location_x;
599  double ty = m_Location_y;
600  // We are looking for big things, so no need to move at 1m steps
601  double ddx = (dx/dist)*100;
602  double ddy = (dy/dist)*100;
604  for (int d=0; d<dist/100; d++)
605  {
606  tx += ddx;
607  ty += ddy;
608  if (m_OurLandscape->SupplyPolyRef((int)tx, (int)ty) != lastpoly)
609  {
610  lastpoly = m_OurLandscape->SupplyPolyRef((int)tx, (int)ty);
611  int openness = (int)m_OurLandscape->SupplyOpenness(lastpoly); // Score calculated by Landscape::CaclulateOpenness
612  if (openness >= m_GooseMinForageOpenness)
613  {
614  GooseMemoryLocation aThought;
615  double grain = m_OurLandscape->SupplyBirdSeedForage(lastpoly); // grain/m2
616  double maize = m_OurLandscape->SupplyBirdMaizeForage(lastpoly); // kJ/m2
617  aThought.m_grain = m_OurPopulationManager->GetFeedingRate(grain, m_myspecies); // kJ/min
618  aThought.m_maize = m_OurPopulationManager->GetMaizeFeedingRate(maize, m_myspecies); // kJ/min
619  aThought.m_grazing = m_OurLandscape->GetActualGooseGrazingForage(lastpoly, m_myspecies); // kJ/min
620  aThought.m_foodresource = GetMaxIntakeRate(aThought.m_grain, aThought.m_maize, aThought.m_grazing);
621  if (aThought.m_foodresource > 0) // don't remember poor food locations
622  {
623  aThought.m_polygonid = lastpoly;
624  aThought.m_x = m_OurLandscape->SupplyCentroidX(lastpoly);
625  aThought.m_y = m_OurLandscape->SupplyCentroidY(lastpoly);
626  aThought.m_threat = 0;
627  int the_dist = g_AlmassMathFuncs.CalcDistPythagorasApprox(m_MyRoost.m_x, m_MyRoost.m_y, aThought.m_x, aThought.m_y);
628  aThought.m_score = m_MyMemory->CalcScore(the_dist, aThought.m_foodresource, aThought.m_threat);
629  m_MyMemory->MemAdd(aThought);
630  }
631  }
632  }
633  }
634 
635 }
ALMaSS_MathFuncs g_AlmassMathFuncs
This variable provides access the to the internal ALMaSS math functions.
Definition: ALMaSS_CmdLine.cpp:137
int CalcDistPythagoras(int a_x, int a_y, int a_x1, int a_y1)
Calculate distance using Pythagoras.
Definition: misc.cpp:42
int CalcDistPythagorasApprox(int a_x, int a_y, int a_x1, int a_y1)
Calculate distance using the Pythagoras approximation.
Definition: misc.cpp:49
int m_y
Definition: ALMaSS_Setup.h:56
int m_x
Definition: ALMaSS_Setup.h:55
GooseSpecies m_myspecies
Holds goose species.
Definition: Goose_Base.h:159
static double m_GooseMinForageOpenness
The minimum openness value a goose will tolerate for forage.
Definition: Goose_Base.h:275
Goose_Population_Manager * m_OurPopulationManager
This is a time saving pointer to the correct population manager object.
Definition: Goose_Base.h:151
double GetMaxIntakeRate(double a_grain, double a_maize, double a_grass)
Returns the max intake rate of the three different types of intake.
Definition: Goose_Base.h:536
double GetMaizeFeedingRate(double a_maizedensity, GooseSpecies a_species)
Get the forage rate when feeding on maize.
Definition: Goose_Population_Manager.h:474
double GetFeedingRate(double a_graindensity, GooseSpecies a_species)
Get the forage rate based on the grain density.
Definition: Goose_Population_Manager.h:457
a data structure to hold goose memory location attributes
Definition: GooseMemoryMap.h:42
double m_grazing
the grazing resource at the location as intake rate kJ/min
Definition: GooseMemoryMap.h:57
double m_foodresource
The max food intake rate (kJ/min) at the location.
Definition: GooseMemoryMap.h:59
double m_maize
the maize resource at the location as intake rate kJ/min
Definition: GooseMemoryMap.h:55
double m_grain
the grain resource at the location as intake rate kJ/min
Definition: GooseMemoryMap.h:53
double m_score
A score used to assess the location.
Definition: GooseMemoryMap.h:63
int m_x
x-coordinate
Definition: GooseMemoryMap.h:47
double m_threat
the threat-level memory strength
Definition: GooseMemoryMap.h:61
int m_y
y-coordinate
Definition: GooseMemoryMap.h:49
int m_polygonid
the unique polygon identification
Definition: GooseMemoryMap.h:51
void MemAdd(GooseMemoryLocation a_gml)
Add a new memory location.
Definition: GooseMemoryMap.cpp:50
double CalcScore(int a_dist, double a_foodresource, double a_threat)
Inline function to calulate overall score for a distance, resource and threat.
Definition: GooseMemoryMap.cpp:273
int SupplyCentroidY(int a_polyref)
Definition: landscape.h:473
double SupplyBirdSeedForage(int a_polyref)
Returns the grain forage resource.
Definition: landscape.h:614
int SupplyCentroidX(int a_polyref)
Definition: landscape.h:470
int SupplyPolyRef(int a_x, int a_y)
Definition: landscape.h:1488
double GetActualGooseGrazingForage(int a_x, int a_y, GooseSpecies a_goose)
Returns the leaf forage resource as seen from a goose standpoint at a polygon referenced by x,...
Definition: landscape.h:596
int SupplyOpenness(int a_poly)
Get openness for a polygon.
Definition: landscape.h:451
double SupplyBirdMaizeForage(int a_polyref)
Returns the maize forage resource.
Definition: landscape.h:628
int m_Location_y
Definition: PopulationManager.h:228
int m_Location_x
Definition: PopulationManager.h:225
Landscape * m_OurLandscape
Definition: PopulationManager.h:229

References ALMaSS_MathFuncs::CalcDistPythagoras(), ALMaSS_MathFuncs::CalcDistPythagorasApprox(), GooseMemoryMap::CalcScore(), g_AlmassMathFuncs, Landscape::GetActualGooseGrazingForage(), Goose_Population_Manager::GetFeedingRate(), Goose_Population_Manager::GetMaizeFeedingRate(), GetMaxIntakeRate(), GooseMemoryLocation::m_foodresource, m_GooseMinForageOpenness, GooseMemoryLocation::m_grain, GooseMemoryLocation::m_grazing, TAnimal::m_Location_x, TAnimal::m_Location_y, GooseMemoryLocation::m_maize, m_MyMemory, m_MyRoost, m_myspecies, TAnimal::m_OurLandscape, m_OurPopulationManager, GooseMemoryLocation::m_polygonid, GooseMemoryLocation::m_score, GooseMemoryLocation::m_threat, APoint::m_x, GooseMemoryLocation::m_x, APoint::m_y, GooseMemoryLocation::m_y, GooseMemoryMap::MemAdd(), Landscape::SupplyBirdMaizeForage(), Landscape::SupplyBirdSeedForage(), Landscape::SupplyCentroidX(), Landscape::SupplyCentroidY(), Landscape::SupplyOpenness(), and Landscape::SupplyPolyRef().

Referenced by Goose_Barnacle_Base::ChooseHopLoc(), Goose_Greylag_Base::ChooseHopLoc(), and Goose_Pinkfoot_Base::ChooseHopLoc().

◆ Explore()

void Goose_Base::Explore ( )

Behavioural exploration of the area to find forage.

This behaviour can be invoked either from the roost or from another location. If from another location then there is an initial move followed by an exploration of the area directly on route to the chosen location. If from the roost then a distance and direction is chosen for the explore. In both cases the movement has energetic costs associated with the flight.

572 {
579  APoint HopLoc;
580  for (int i = 0; i < 1; i++)
581  {
582  HopLoc = ChooseHopLoc(); // The distance moved is dependent on the species and this is controlled by the inherited ChooseHopLoc code.
583  }
584  FlyTo( HopLoc );
585 }
A simple class defining an x,y coordinate set.
Definition: ALMaSS_Setup.h:53
virtual APoint ChooseHopLoc()
Pick a hop location point within a_dist meters - must be overridden by descendent classes.
Definition: Goose_Base.h:363
void FlyTo(int a_x, int a_y)
The goose flys to the location specified by a_x, a_y.
Definition: Goose_Base.cpp:409

References ChooseHopLoc(), and FlyTo().

Referenced by st_ChooseForageLocation().

◆ FlyTo() [1/2]

void Goose_Base::FlyTo ( APoint  a_pt)
protected

The goose flys to the location specified by a_pt.

404 {
405  FlyTo(a_pt.m_x,a_pt.m_y);
406 }

References FlyTo(), APoint::m_x, and APoint::m_y.

◆ FlyTo() [2/2]

void Goose_Base::FlyTo ( int  a_x,
int  a_y 
)
protected

The goose flys to the location specified by a_x, a_y.

Moves the bird from m_Location_x,m_Location_y to a_x,a_y. Assumes that the cost of flight is directly proportional to the distance x bird weight. The cost is calcuated and removed from the energy reserve. To save some calculation costs (sqrt is expensive in time) we use an approximation to Pythagorus accurate to around 6%. m_weightTotal is in grams and m_flightcost the cost of moving 1 gram per m, all distances in meters. NB all flying trips are assumed to take 10 minutes but the energy used is determined by the distance.

and sets the new location

and finally store the information about flight number and distance

410 {
419  if ((m_Location_x == a_x) && (m_Location_y == a_y)) return;
421  double cost = dist * GetFlightCost();
422  m_energyToday-=cost;
424  m_Location_x = a_x;
425  m_Location_y = a_y;
427  m_FlightNumber++;
428  m_FlightDistance += dist;
429 
430 }
int m_FlightNumber
Counter for the number of flights per day.
Definition: Goose_Base.h:307
double m_energyToday
The bird's daily energy account (kJ)
Definition: Goose_Base.h:207
int m_FlightDistance
Storage for the total distance flown per day.
Definition: Goose_Base.h:311
double GetFlightCost()
Get the flight costs per m per g.
Definition: Goose_Base.h:568

References ALMaSS_MathFuncs::CalcDistPythagorasApprox(), g_AlmassMathFuncs, GetFlightCost(), m_energyToday, m_FlightDistance, m_FlightNumber, TAnimal::m_Location_x, and TAnimal::m_Location_y.

Referenced by Explore(), FlyTo(), On_MoveTo(), st_ChooseForageLocation(), Goose_Barnacle_Base::st_ToRoost(), Goose_Greylag_Base::st_ToRoost(), and Goose_Pinkfoot_Base::st_ToRoost().

◆ GetBodyCondition()

double Goose_Base::GetBodyCondition ( )
inline

Returns the current body condition.

394 { return m_TheBodyCondition; }

References m_TheBodyCondition.

◆ GetDailyEnergyBudget()

double Goose_Base::GetDailyEnergyBudget ( )
inline

Returns the daily energy budget.

450  {
451  return m_DEB;
452  }
double m_DEB
The daily energy budget excluding flying (kJ)
Definition: Goose_Base.h:191

References m_DEB.

◆ GetDailyEnergyExpenditure()

double Goose_Base::GetDailyEnergyExpenditure ( )
inline

Returns the daily energy expenditure.

456  {
457  return m_energyToday;
458  }

References m_energyToday.

◆ GetFlightCost()

double Goose_Base::GetFlightCost ( )
inline

Get the flight costs per m per g.

568  {
569  return m_flightcost * m_weightTotal;
570  }
double m_weightTotal
The weight of the bird in g including fat reserve.
Definition: Goose_Base.h:179
static double m_flightcost
The cost of flight per g per m in kJ.
Definition: Goose_Base.h:227

References m_flightcost, and m_weightTotal.

Referenced by FlyTo().

◆ GetFlightDistance()

int Goose_Base::GetFlightDistance ( )
inline

Returns the total daily distance flown.

444  {
445  return m_FlightDistance;
446  }

References m_FlightDistance.

◆ GetFlightNumber()

int Goose_Base::GetFlightNumber ( )
inline

Returns the total daily number of flights.

438  {
439  return m_FlightNumber;
440  }

References m_FlightNumber.

◆ GetForageLocIndex()

int Goose_Base::GetForageLocIndex ( )
inline

Gets for the forage location index.

418 { return m_myForageIndex; }
int m_myForageIndex
Temporary storage for a forage location index - this is a speed optimisation.
Definition: Goose_Base.h:291

References m_myForageIndex.

Referenced by Goose_Population_Manager::GetLeader(), and st_ChooseForageLocation().

◆ GetForagingTime()

int Goose_Base::GetForagingTime ( int  a_EndForagingTime,
double  a_RoostLeaveTime 
)

Returns the time spent foraging.

Parameters
[in]a_EndForagingTimeThe time of day where a goose hits it's daily max intake
[in]a_RoostLeaveTimeThe time of day where a goose leaves the roost
Returns
The difference between roost leave time and end foraging time
739 {
740  int foraging_time = -1;
741  int day_length = m_OurLandscape->SupplyDaylength();
742  int roost_leave_time = (int)a_RoostLeaveTime;
743  if (roost_leave_time < 0) {
744  roost_leave_time = 0;
745  }
746  // If they never hit their daily max, they are assigned 1440.
747  if (a_EndForagingTime == 1440)
748  {
749  foraging_time = day_length - roost_leave_time;
750  }
751  else
752  {
753  foraging_time = a_EndForagingTime - roost_leave_time;
754  }
755  if (foraging_time == -1)
756  {
757  m_OurLandscape->Warn("Goose_Base::CalcForagingTime()","error in foraging time calculation");
758  exit(0);
759  }
760  return foraging_time;
761 }
int SupplyDaylength(void)
Definition: landscape.h:1530
void Warn(std::string a_msg1, std::string a_msg2)
Definition: landscape.h:1579

References TAnimal::m_OurLandscape, Landscape::SupplyDaylength(), and Landscape::Warn().

Referenced by StartDay().

◆ GetGooseMinForageRate()

double Goose_Base::GetGooseMinForageRate ( GooseSpecies  a_species)
inline

Returns the minimum forage rate for the species.

Parameters
[in]a_speciesThe type of goose species
Returns
The minimum forage rate the goose will accept.
472  {
473  return m_mingooseforagerate[a_species];
474  }
static double m_mingooseforagerate[gs_foobar]
The minimum tolerable forage rate in kJ/minute for the species.
Definition: Goose_Base.h:235

References m_mingooseforagerate.

Referenced by st_Forage().

◆ GetGroupsize()

int Goose_Base::GetGroupsize ( )
inline

Returns the groupsize.

410 { return m_groupsize; }
int m_groupsize
The size of the group this bird represents.
Definition: Goose_Base.h:171

References m_groupsize.

Referenced by Goose_Population_Manager::DoLast(), and AOR_Probe_Goose::DoProbe().

◆ GetMaxAppetiteHitTime()

int Goose_Base::GetMaxAppetiteHitTime ( )
inline

Returns m_DailyMaxAppetiteHitTime.

432  {
434  }
int m_DailyMaxAppetiteHitTime
The time of day when m_DailyMaxAppetite was hit.
Definition: Goose_Base.h:203

References m_DailyMaxAppetiteHitTime.

◆ GetMaxForageRate()

double Goose_Base::GetMaxForageRate ( double  a_grain,
double  a_maize,
double  a_grass,
double  a_interferenceComp,
bool  a_iscereal,
TTypesOfVegetation  a_veg,
bool  a_stubble,
TTypesOfVegetation  a_prevcrop 
)
inline

Returns the max forage rate of the three different types of forage The max rate is adjusted according to feeding time in the time budget, according to the interference competition value and to the current snow depth in the landscape.

Parameters
[in]a_grainThe intake rate from the grain resource
[in]a_maizeThe intake rate from the maize resource
[in]a_grassThe intake rate from the grazing resource
[in]a_interferenceCompThe scaler for interference competition
[in]a_iscerealFlag for a cereal crop or not (false)
[in]a_vegThe vegetation type
[in]a_stubbleFlag for a crop in stubble or not (false)
[in]a_prevcropThe previously sown crop
Returns
The max forage rate scaled to time budget and interference competetion
489  {
490  double MaxRate = 0.0;
491  if (a_grain > MaxRate) {
492  MaxRate = a_grain;
494  }
495  else if (a_maize > MaxRate) {
496  MaxRate = a_maize;
498  }
499  else if (a_grass > MaxRate) {
500  MaxRate = a_grass;
502  }
503  else
504  {
505  MaxRate = 0;
507  }
508  MaxRate *= a_interferenceComp;
509  MaxRate = AdjustIntakeRateToSnowDepth(MaxRate);
510  m_MaxIntakeSource.m_iscereal = a_iscereal;
511  m_MaxIntakeSource.m_instubble = a_stubble;
512  m_MaxIntakeSource.m_veg = a_veg;
513  m_MaxIntakeSource.m_prevsowncrop = a_prevcrop;
514  /**** CJT DEBUG ****
515  if ((a_stubble) && (!a_iscereal) && (m_MaxIntakeSource.m_maxintakesource == tomis_grain))
516  {
517  g_msg->WarnAddInfo(WARN_BUG, "Day ", m_OurLandscape->SupplyDayInYear());
518  g_msg->WarnAddInfo(WARN_BUG, "Veg ", a_veg);
519  g_msg->WarnAddInfo(WARN_BUG, "Prev Crop ", a_prevcrop);
520  g_msg->WarnAddInfo(WARN_BUG, "Grain ", a_grain);
521  g_msg->WarnAddInfo(WARN_BUG, "******** ", 0);
522  }
523  //**** END ****/
524 
525 
526  return MaxRate;
527  }
@ tomis_grass
Definition: Goose_Base.h:92
@ tomis_foobar
Definition: Goose_Base.h:96
@ tomis_sowncrop
Definition: Goose_Base.h:93
@ tomis_maize
Definition: Goose_Base.h:94
@ tomis_grain
Definition: Goose_Base.h:95
TMaxIntakeSource m_MaxIntakeSource
Holds information about the food source which gave max intake rate.
Definition: Goose_Base.h:211
double AdjustIntakeRateToSnowDepth(double a_intakerate)
When there is snow, the intake rate is decreased by 10 % per cm of snow.
Definition: Goose_Base.cpp:730
bool m_iscereal
Flag for whether the intake source is a cereal.
Definition: Goose_Base.h:119
bool m_instubble
Flag to indicate if the intake source was in stubble.
Definition: Goose_Base.h:123
TTypeOfMaxIntakeSource m_maxintakesource
The intake source which gave the maximum intake.
Definition: Goose_Base.h:117
TTypesOfVegetation m_veg
The vegetation type.
Definition: Goose_Base.h:121
TTypesOfVegetation m_prevsowncrop
The previous sown crop on the forage location.
Definition: Goose_Base.h:125

References AdjustIntakeRateToSnowDepth(), TMaxIntakeSource::m_instubble, TMaxIntakeSource::m_iscereal, TMaxIntakeSource::m_maxintakesource, m_MaxIntakeSource, TMaxIntakeSource::m_prevsowncrop, TMaxIntakeSource::m_veg, tomis_foobar, tomis_grain, tomis_grass, tomis_maize, and tomis_sowncrop.

Referenced by st_ChooseForageLocation(), and st_Forage().

◆ GetMaxIntakeRate()

double Goose_Base::GetMaxIntakeRate ( double  a_grain,
double  a_maize,
double  a_grass 
)
inline

Returns the max intake rate of the three different types of intake.

Parameters
[in]a_grainThe intake rate from the grain resource kJ/min
[in]a_maizeThe intake rate from the maize resource kJ/min
[in]a_grassThe intake rate from the grazing resource kJ/min
Returns
The max intake rate kJ/min
536  {
537  double MaxRate = 0.0;
538  if (a_grain > MaxRate) {
539  MaxRate = a_grain;
540  }
541  if (a_maize > MaxRate) {
542  MaxRate = a_maize;
543  }
544  if (a_grass > MaxRate) {
545  MaxRate = a_grass;
546  }
547  return MaxRate;
548  }

Referenced by EvaluateForageToHopLoc(), and st_ChooseForageLocation().

◆ GetMaxIntakeSource()

TMaxIntakeSource Goose_Base::GetMaxIntakeSource ( )
inline

Supply the current max intake source.

349  {
350  return m_MaxIntakeSource;
351  }

References m_MaxIntakeSource.

Referenced by Goose_Population_Manager::DoLast().

◆ GetRoost()

APoint Goose_Base::GetRoost ( )
inline

Supply roost coords.

345 { return m_MyRoost; }

References m_MyRoost.

Referenced by Goose_Population_Manager::GetLeader().

◆ GetRoostLeaveTime()

double Goose_Base::GetRoostLeaveTime ( )
inline

Returns the time when the goose leaves the roost.

560 { return m_LeaveRoostTime; }
double m_LeaveRoostTime
Controls the time when the goose will leave the roost.
Definition: Goose_Base.h:215

References m_LeaveRoostTime.

◆ GetSex()

bool Goose_Base::GetSex ( )
inline

Returns the sex.

428 { return m_sex; }
bool m_sex
Sex of bird, true = male false = female.
Definition: Goose_Base.h:155

References m_sex.

◆ GetSpecies()

GooseSpecies Goose_Base::GetSpecies ( )
inline

Returns the species.

422  {
423  return m_myspecies;
424  }

References m_myspecies.

Referenced by Goose_Population_Manager::DoLast().

◆ GetTotalWeight()

double Goose_Base::GetTotalWeight ( )
inline

Returns the weight of the bird.

558 {return m_weightTotal;}

References m_weightTotal.

◆ Init()

void Goose_Base::Init ( Goose_Population_Manager p_NPM,
double  a_weight,
bool  a_sex,
APoint  a_roost 
)

Intitialise object.

Assigns the pointer to the population manager.

Sets the initial state.

Sets the sex.

Sets the weight.

Todo:
Quick fix for spring migration weights

Calculates BMR

111  {
113  m_OurPopulationManager = p_NPM;
117  SetSex(a_sex);
119  m_weight = a_weight;
120  m_DailyMaxAppetite = 0.0;
123  int today = m_OurLandscape->SupplyDayInYear();
125  m_energyReserve = m_weight * 0.22;
126  }
129  m_BMR = pow(m_weightTotal / 1000, cfg_goose_BMRconstant2.value())*cfg_goose_BMRconstant1.value(); // BMR is used to scale other energetic costs on a daily basis
130  m_energyToday = 0.0;
132  m_TheBodyCondition = 0.0;
133  for (unsigned i = 0; i < 5; i++)
134  {
135  double condition = m_weightTotal / m_weight; // total weight divided by lean weight.
136  SetBodyCondition(condition, i);
138  }
139  m_LeaveRoostTime = 0; // intialisation
140  m_myForageIndex = -1; // -1 signals not currently foraging
141  m_MaxIntakeSource.m_maxintakesource = tomis_foobar; // The source of the max forage intake rate has not been determined yet.
142  // Assume a default groupsize of 1, if otherwise it needs setting in descendent classes
143  m_groupsize = 1;
144  // Set the roost and location
145  m_Location_x = a_roost.m_x;
146  m_Location_y = a_roost.m_y;
147  m_MyRoost.m_x = a_roost.m_x;
148  m_MyRoost.m_y = a_roost.m_y;
149 
150  // Any other intialisation will be done by descendent class constructors
151  m_MyMemory = new GooseMemoryMap(this);
152  // the species must be reset by the goose constructor
153  m_myspecies = gs_foobar;
154  // Must calculate the DEB now or risk use of an undefined m_DEB in StartDay
155  m_DEB = 0;
156  // Set the individual minimum forage rate acceptable. Overwritten later in StartDay
158  m_FlightNumber = 0;
159  m_FlightDistance = 0;
160  m_forageLocCount = 0;
161 }
CfgFloat cfg_goose_InitialEnergyReserveProportion
The initial proportion of weight that can be stored as energy reserves.
CfgInt cfg_goose_pf_springmigdatestart
Input: Date for onset of spring migration.
CfgFloat cfg_goose_BMRconstant1
The cost of BMR per kg goose - constant 1.
CfgInt cfg_goose_pf_springmigdateend
Input: Date for end of spring migration.
CfgFloat cfg_goose_BMRconstant2
The cost of BMR per kg goose - constant 2.
@ togs_InitialState
Definition: Goose_Base.h:76
int value(void)
Definition: configurator.h:98
int m_forageLocCount
The number of forage locations visited today.
Definition: Goose_Base.h:183
unsigned m_BodyConditionCounter
A counter for the daily body condition.
Definition: Goose_Base.h:287
void AddBodyCondition(double a_condition)
Alters body conditon by addition of a double value.
Definition: Goose_Base.h:402
TTypeOfGoose_BaseState CurrentGState
Variable to record current behavioural state.
Definition: Goose_Base.h:147
double m_energyReserve
The bird's energy reserves in grams.
Definition: Goose_Base.h:223
double m_BMR
The daily BMR.
Definition: Goose_Base.h:187
double m_BodyCondition[5]
A variable describing current body condition over the past 5 days.
Definition: Goose_Base.h:279
void Set_Indivmingooseforagerate(double a_cost)
Set the mimimum tolerated forage rate for the individual goose.
Definition: Goose_Base.h:578
void SetSex(bool a_sex)
Sets the sex.
Definition: Goose_Base.h:552
double m_weight
The weight of the bird in gram excluding fat reserve.
Definition: Goose_Base.h:175
void SetBodyCondition(double a_condition, unsigned a_index)
Sets the current body condition.
Definition: Goose_Base.h:398
double m_DailyMaxAppetite
The daily max kJ possible to get as intake.
Definition: Goose_Base.h:195
The class describing both local and seasonal goose memories and cognition.
Definition: GooseMemoryMap.h:94
int SupplyDayInYear(void)
Definition: landscape.h:1596

References cfg_goose_BMRconstant1, cfg_goose_BMRconstant2, cfg_goose_InitialEnergyReserveProportion, cfg_goose_pf_springmigdateend, cfg_goose_pf_springmigdatestart, APoint::m_x, APoint::m_y, togs_InitialState, tomis_foobar, CfgInt::value(), and CfgFloat::value().

Referenced by Goose_Base(), Goose_Barnacle_Base::Init(), Goose_Greylag_Base::Init(), Goose_Pinkfoot_Base::Init(), and ReInit().

◆ KillThis()

void Goose_Base::KillThis ( void  )
virtual

The bird is dead of some external cause.

Kill this for single animal agents is straightforward. We need to remove the bird from the forage area if any.

Reimplemented from TAnimal.

Reimplemented in Goose_Pinkfoot_FamilyGroup, Goose_Greylag_FamilyGroup, and Goose_Barnacle_FamilyGroup.

704 {
708  if (m_myForageIndex != -1)
709  {
711  }
712  TAnimal::KillThis(); // Sets CurrentStateNo to -1, and StepDone to true
713 }
GooseSpeciesType m_myGooseSpeciesType
Holds the goose species type.
Definition: Goose_Base.h:163
void RemoveGeeseFromForageLocation(GooseSpeciesType a_type, int a_index, int a_number)
Removes a goose or geese to the forage location - requires an index.
Definition: Goose_Population_Manager.cpp:1812
virtual void KillThis()
Definition: PopulationManager.h:219

References TAnimal::KillThis(), m_myForageIndex, m_myGooseSpeciesType, m_OurPopulationManager, and Goose_Population_Manager::RemoveGeeseFromForageLocation().

◆ On_Bang() [1/2]

void Goose_Base::On_Bang ( int  a_polyid)

The goose is scared by a bang at location.

The goose has heard a shot. It remembers the location the shot came from as bad and flies away to find another place to forage. This version assumes the scare value is a constant 1.0. The first test is because the shot might have killed it already!

Parameters
[in]a_polyidThe polygon id from where the shot was fired.

We have been scared off, so we the correct number of geese at that location before we fly off to find a new forage location

639 {
646  if (m_CurrentStateNo == -1) return;
647  if (!m_MyMemory->ChangeAddThreat(a_polyid, 1.0))
648  {
649  GooseMemoryLocation aThought;
650  aThought.m_polygonid = a_polyid;
651  aThought.m_x = m_OurLandscape->SupplyCentroidX(a_polyid);
652  aThought.m_y = m_OurLandscape->SupplyCentroidY(a_polyid);
653  aThought.m_threat = 1;
654  int dist = g_AlmassMathFuncs.CalcDistPythagorasApprox( m_MyRoost.m_x, m_MyRoost.m_y, aThought.m_x, aThought.m_y );
655  aThought.m_score = m_MyMemory->CalcScore( dist, aThought.m_foodresource, aThought.m_threat );
656  m_MyMemory->MemAdd(aThought);
657  }
661  if (m_myForageIndex != -1)
662  {
664  }
665  m_myForageIndex = -1;
667 }
TTypeOfGoose_BaseState st_ChooseForageLocation(void)
Selects a forage location based on past memory, or initiates an exploration.
Definition: Goose_Base.cpp:258
bool ChangeAddThreat(int a_polyid, double a_threat)
Add to threat at a memory location.
Definition: GooseMemoryMap.cpp:123
int m_CurrentStateNo
The basic state number for all objects - '-1' indicates death.
Definition: PopulationManager.h:116

References ALMaSS_MathFuncs::CalcDistPythagorasApprox(), GooseMemoryMap::CalcScore(), GooseMemoryMap::ChangeAddThreat(), CurrentGState, g_AlmassMathFuncs, TALMaSSObject::m_CurrentStateNo, GooseMemoryLocation::m_foodresource, m_groupsize, m_myForageIndex, m_myGooseSpeciesType, m_MyMemory, m_MyRoost, TAnimal::m_OurLandscape, m_OurPopulationManager, GooseMemoryLocation::m_polygonid, GooseMemoryLocation::m_score, GooseMemoryLocation::m_threat, APoint::m_x, GooseMemoryLocation::m_x, APoint::m_y, GooseMemoryLocation::m_y, GooseMemoryMap::MemAdd(), Goose_Population_Manager::RemoveGeeseFromForageLocation(), st_ChooseForageLocation(), Landscape::SupplyCentroidX(), and Landscape::SupplyCentroidY().

Referenced by Goose_Population_Manager::BangAtPoly().

◆ On_Bang() [2/2]

void Goose_Base::On_Bang ( int  a_polyid,
double  a_scare 
)

The goose is scared by a bang at location.

The goose has heard a shot. It remembers the location the shot came from as bad and flies away to find another place to forage. This version allows a variable scare value to be remembered. The first test is because the shot might have killed it already!

Parameters
[in]a_polyidThe polygon id from where the shot was fired.
[in]a_scareThe scare value.

We have been scared off, so we the correct number of geese at that location before we fly off to find a new forage location

671 {
679  if (m_CurrentStateNo == -1) return;
680  if (!m_MyMemory->ChangeAddThreat(a_polyid, a_scare))
681  {
682  GooseMemoryLocation aThought;
683  aThought.m_polygonid = a_polyid;
684  aThought.m_x = m_OurLandscape->SupplyCentroidX(a_polyid);
685  aThought.m_y = m_OurLandscape->SupplyCentroidY(a_polyid);
686  aThought.m_threat = a_scare;
687  int dist = g_AlmassMathFuncs.CalcDistPythagorasApprox( m_MyRoost.m_x, m_MyRoost.m_y, aThought.m_x, aThought.m_y );
688  aThought.m_score = m_MyMemory->CalcScore( dist, aThought.m_foodresource, aThought.m_threat );
689  m_MyMemory->MemAdd(aThought);
690  }
694  if (m_myForageIndex != -1)
695  {
697  }
698  m_myForageIndex = -1;
700 }

References ALMaSS_MathFuncs::CalcDistPythagorasApprox(), GooseMemoryMap::CalcScore(), GooseMemoryMap::ChangeAddThreat(), CurrentGState, g_AlmassMathFuncs, TALMaSSObject::m_CurrentStateNo, GooseMemoryLocation::m_foodresource, m_groupsize, m_myForageIndex, m_myGooseSpeciesType, m_MyMemory, m_MyRoost, TAnimal::m_OurLandscape, m_OurPopulationManager, GooseMemoryLocation::m_polygonid, GooseMemoryLocation::m_score, GooseMemoryLocation::m_threat, APoint::m_x, GooseMemoryLocation::m_x, APoint::m_y, GooseMemoryLocation::m_y, GooseMemoryMap::MemAdd(), Goose_Population_Manager::RemoveGeeseFromForageLocation(), st_ChooseForageLocation(), Landscape::SupplyCentroidX(), and Landscape::SupplyCentroidY().

◆ On_Emigrate()

virtual void Goose_Base::On_Emigrate ( )
inlinevirtual

Cause the bird to immediately transition to Emigrate.

388  {
390  }
@ togs_Emigrate
Definition: Goose_Base.h:82

References CurrentGState, and togs_Emigrate.

◆ On_Migrate()

void Goose_Base::On_Migrate ( TTypeOfLeaveReason  a_leavereason)

The goose is told to leave the simulation area (poss due to bad weather)

We need to migrate out of the simulation and record the reason for leaving. This is currently done by killing the bird. No birds are migrating back into the simulation.

Parameters
[in]a_leavereasonThe reason for leaving. One of the values in the enum TTypeOfLeaveReason.
723 {
726 }
@ togs_Die
Definition: Goose_Base.h:81
void RecordLeaveReason(TTypeOfLeaveReason a_leavereason, GooseSpeciesType a_speciestype)
Record the reason for leaving.
Definition: Goose_Population_Manager.cpp:2280

References CurrentGState, m_myGooseSpeciesType, m_OurPopulationManager, Goose_Population_Manager::RecordLeaveReason(), and togs_Die.

Referenced by StartDay(), Goose_Barnacle_FamilyGroup::Step(), Goose_Barnacle_NonBreeder::Step(), Goose_Greylag_FamilyGroup::Step(), Goose_Greylag_NonBreeder::Step(), Goose_Pinkfoot_FamilyGroup::Step(), and Goose_Pinkfoot_NonBreeder::Step().

◆ On_MoveTo()

void Goose_Base::On_MoveTo ( int  a_x,
int  a_y 
)
inline

The goose is moved to the location specified by a_x, a_y - caused by group decision.

640 { FlyTo( a_x, a_y); }

References FlyTo().

◆ ReInit()

void Goose_Base::ReInit ( Landscape p_L,
Goose_Population_Manager p_NPM,
double  a_weight,
bool  a_sex,
APoint  a_roost 
)

ReInit for object pool.

168  {
169  TAnimal::ReinitialiseObject(0, 0, p_L);
170  // Assign the pointer to the population manager
171  Init(p_NPM, a_weight, a_sex, a_roost);
172 }
virtual void ReinitialiseObject()
Used to re-use an object - must be implemented in descendent classes.
Definition: PopulationManager.h:143

References Init(), and TALMaSSObject::ReinitialiseObject().

Referenced by Goose_Barnacle_Base::ReInit(), Goose_Greylag_Base::ReInit(), and Goose_Pinkfoot_Base::ReInit().

◆ ScaleForageToGroupsize()

double Goose_Base::ScaleForageToGroupsize ( double  a_forage)
inline

Scales forage to groupsize.

414 { return m_groupsize * a_forage; }

References m_groupsize.

Referenced by st_Forage().

◆ Set_GooseFattoKJConversion()

void Goose_Base::Set_GooseFattoKJConversion ( double  a_cost)
inline

Set the fat to kJ conversion constant for all geese.

600 { m_GooseFattoKJConversion = a_cost; }
static double m_GooseFattoKJConversion
Conversion rate fat to kJ.
Definition: Goose_Base.h:271

References m_GooseFattoKJConversion.

Referenced by Goose_Population_Manager::Goose_Population_Manager().

◆ Set_GooseFieldForageDist()

void Goose_Base::Set_GooseFieldForageDist ( double  sp1,
double  sp2,
double  sp3 
)
inline

Set the max forage distance from a field for all geese.

623  {
624  //Dist
625  m_GooseFieldForageDist[gs_Pinkfoot] = sp1;
626  m_GooseFieldForageDist[gs_Barnacle] = sp2;
627  m_GooseFieldForageDist[gs_Greylag] = sp3;
628  // DistX2
629  m_GooseFieldForageDistX2[gs_Pinkfoot] = sp1 * 2.0;
630  m_GooseFieldForageDistX2[gs_Barnacle] = sp2 * 2.0;
631  m_GooseFieldForageDistX2[gs_Greylag] = sp3 * 2.0;
632  }
static double m_GooseFieldForageDist[gs_foobar]
The maximum distance travelled from roost to forage sites for each species of goose (m)
Definition: Goose_Base.h:247
static double m_GooseFieldForageDistX2[gs_foobar]
Double the maximum distance travelled from roost to forage sites for each species of goose (m) - this...
Definition: Goose_Base.h:251

References m_GooseFieldForageDist, and m_GooseFieldForageDistX2.

Referenced by Goose_Population_Manager::Goose_Population_Manager().

◆ Set_GooseFollowingLikelyhood()

void Goose_Base::Set_GooseFollowingLikelyhood ( int  a_likelyhood,
GooseSpeciesType  a_speciestype 
)
inline

Set the followinglikelyhood.

634 { m_followinglikelyhood[a_speciestype] = a_likelyhood;}
static int m_followinglikelyhood[(int) gst_foobar]
An attribute used to determine the chance of following or exploring when foraging.
Definition: Goose_Base.h:303

References m_followinglikelyhood.

Referenced by Goose_Population_Manager::Goose_Population_Manager().

◆ Set_GooseForageDist()

void Goose_Base::Set_GooseForageDist ( double  sp1,
double  sp2,
double  sp3 
)
inline

Set the max forage distance from roost for all geese.

609  {
610  //Dist
611  m_GooseForageDist[gs_Pinkfoot] = sp1;
612  m_GooseForageDist[gs_Barnacle] = sp2;
613  m_GooseForageDist[gs_Greylag] = sp3;
614  // DistX2
615  m_GooseForageDistX2[gs_Pinkfoot] = sp1 * 2.0;
616  m_GooseForageDistX2[gs_Barnacle] = sp2 * 2.0;
617  m_GooseForageDistX2[gs_Greylag] = sp3 * 2.0;
618  }
static double m_GooseForageDistX2[gs_foobar]
Double the maximum distance travelled from roost to forage sites for each species of goose (m) - this...
Definition: Goose_Base.h:243
static double m_GooseForageDist[gs_foobar]
The maximum distance travelled from roost to forage sites for each species of goose (m)
Definition: Goose_Base.h:239

References m_GooseForageDist, and m_GooseForageDistX2.

Referenced by Goose_Population_Manager::Goose_Population_Manager().

◆ Set_GooseKJtoFatConversion()

void Goose_Base::Set_GooseKJtoFatConversion ( double  a_cost)
inline

Set the kJ to fat conversion constant for all geese.

596 { m_GooseKJtoFatConversion = a_cost; }
static double m_GooseKJtoFatConversion
Conversion rate kJ to fat.
Definition: Goose_Base.h:267

References m_GooseKJtoFatConversion.

Referenced by Goose_Population_Manager::Goose_Population_Manager().

◆ Set_GooseLeavingRoost()

void Goose_Base::Set_GooseLeavingRoost ( bool  a_leaving)
inline

Set the flag to indicate if we are coming from the roost.

636 {m_LeavingRoost = a_leaving;}
bool m_LeavingRoost
Flag to indicate that we are coming from the roost. Used to control code for "following".
Definition: Goose_Base.h:219

References m_LeavingRoost.

Referenced by Goose_Population_Manager::Goose_Population_Manager(), st_ChooseForageLocation(), and st_Roost().

◆ Set_GooseLeavingThreshold()

void Goose_Base::Set_GooseLeavingThreshold ( double  a_threshold)
inline

Set the body condition threshold for leaving for all geese.

584 { m_GooseLeavingThreshold = a_threshold; }
static double m_GooseLeavingThreshold
The trigger for leaving as a 5 day average of body condition.
Definition: Goose_Base.h:255

References m_GooseLeavingThreshold.

Referenced by Goose_Population_Manager::Goose_Population_Manager().

◆ Set_GooseMaxAppetiteScaler()

void Goose_Base::Set_GooseMaxAppetiteScaler ( double  a_cost)
inline

Set the goose appetite scale used to calculate max intake for all geese.

588 { m_GooseMaxAppetiteScaler = a_cost; }
static double m_GooseMaxAppetiteScaler
Scaler to determine the max kJ possible to eat per day based on non-energy reserve weight.
Definition: Goose_Base.h:259

References m_GooseMaxAppetiteScaler.

Referenced by Goose_Population_Manager::Goose_Population_Manager().

◆ Set_GooseMaxEnergyReserveProportion()

void Goose_Base::Set_GooseMaxEnergyReserveProportion ( double  a_prop)
inline

Set the maximum energy reserve proportion allowed for all geese.

static double m_GooseMaxEnergyReserveProportion
Max proportion of weight that can be energy reserve.
Definition: Goose_Base.h:263

References m_GooseMaxEnergyReserveProportion.

Referenced by Goose_Population_Manager::Goose_Population_Manager().

◆ Set_GooseMinForageOpenness()

void Goose_Base::Set_GooseMinForageOpenness ( double  a_cost)
inline

Set the min forage openess for all geese.

604 { m_GooseMinForageOpenness = a_cost; }

References m_GooseMinForageOpenness.

Referenced by Goose_Population_Manager::Goose_Population_Manager().

◆ Set_Indivmingooseforagerate()

void Goose_Base::Set_Indivmingooseforagerate ( double  a_cost)
inline

Set the mimimum tolerated forage rate for the individual goose.

578  {
579  m_Indivmingooseforagerate = a_cost;
580  }
double m_Indivmingooseforagerate
The minimum tolerable forage rate in kJ/minute for the individual.
Definition: Goose_Base.h:231

References m_Indivmingooseforagerate.

Referenced by Goose_Population_Manager::Goose_Population_Manager(), st_Forage(), and StartDay().

◆ Set_mingooseforagerate()

void Goose_Base::Set_mingooseforagerate ( double  a_cost,
GooseSpecies  a_species 
)
inline

Set the mimimum tolerated forage rate for all geese.

574 { m_mingooseforagerate[a_species] = a_cost; }

References m_mingooseforagerate.

Referenced by Goose_Population_Manager::Goose_Population_Manager(), and StartDay().

◆ SetBodyCondition()

void Goose_Base::SetBodyCondition ( double  a_condition,
unsigned  a_index 
)
inline

Sets the current body condition.

398 { m_BodyCondition[a_index] = a_condition; }

References m_BodyCondition.

Referenced by StartDay().

◆ SetFlightCost()

void Goose_Base::SetFlightCost ( double  a_cost)
inline

Set the flight cost per m per g.

564 { m_flightcost = a_cost; }

References m_flightcost.

Referenced by Goose_Population_Manager::Goose_Population_Manager().

◆ SetSex()

void Goose_Base::SetSex ( bool  a_sex)
inline

Sets the sex.

552  {
553  m_sex = a_sex;
554  }

References m_sex.

◆ st_ChooseForageLocation()

TTypeOfGoose_BaseState Goose_Base::st_ChooseForageLocation ( void  )
protected

Selects a forage location based on past memory, or initiates an exploration.

  1. If we are following then find a good location from the main list of birds held by the population manager. If no such location is available then default to explore.

Depending on the rules in force we probably only want to follow geese from our own species, and maybe from our own roost

First searches memory for the best forage location remembered. If it finds one then it flies there and calculates the energetic cost. If no suitable memory is found then initiates an exploration.

Once the goose arrives at a forage location it needs to add itself to the geese already there, or initiate a forage location if one does not exist.

259 {
260  // Debugging
262  int today = m_OurLandscape->SupplyDayInYear();
263  int dtime = m_OurPopulationManager->GetDayTime();
264  int daylength = m_OurLandscape->SupplyDaylength();
265  if (dtime >= daylength + cfg_goose_AfterDarkTime.value())
266  {
267 #ifdef __DEBUG_GOOSE
268  if (m_myForageIndex != -1)
269  {
271  g_msg->Warn("Goose_Base::st_ChooseForageLocation - Removing negative geese from forage location", (double)(m_OurPopulationManager->GetBirdsAtForageLoc(m_myForageIndex, m_myGooseSpeciesType) - m_groupsize));
272  exit(0);
273  }
274  }
275 #endif
276  return togs_ToRoost;
277  }
278 
280  {
289 #ifdef __FOLLOW_FIELD
290  int index = -1;
292  if (forageindex > -1) {
293  index = forageindex;
294  }
295 #endif
296 
297 #ifdef __FOLLOW_BIRD
299  if (leader != NULL) {
300  int index = leader->GetForageLocIndex();
301  }
302 #endif
303 
304  if (index > -1)
305  {
306 
309  Set_GooseLeavingRoost(false); // We've left the roost now, so reset
310  GooseMemoryLocation aThought;
311  int poly = gafl->GetPolygonref();
312  double grain = gafl->GetGrainDensity(); // grain/m2
313  double maize = gafl->GetMaizeDensity(); // kJ/m2
314  aThought.m_grain = m_OurPopulationManager->GetFeedingRate(grain, m_myspecies); // kJ/min
315  aThought.m_maize = m_OurPopulationManager->GetMaizeFeedingRate(maize, m_myspecies); // kJ/min
316  aThought.m_grazing = gafl->GetGrazing( (int)m_myspecies ); // kJ/min
317  aThought.m_foodresource = GetMaxIntakeRate(aThought.m_grain, aThought.m_maize, aThought.m_grazing);
318  aThought.m_polygonid = poly;
319  aThought.m_x = m_OurLandscape->SupplyCentroidX( poly );
320  aThought.m_y = m_OurLandscape->SupplyCentroidY( poly );
321  aThought.m_threat = 0;
322  int dist = g_AlmassMathFuncs.CalcDistPythagorasApprox( m_MyRoost.m_x, m_MyRoost.m_y, aThought.m_x, aThought.m_y );
323  aThought.m_score = m_MyMemory->CalcScore(dist, aThought.m_foodresource, aThought.m_threat);
324  if (!m_MyMemory->IsKnownArea( gafl->GetPolygonref() )) m_MyMemory->MemAdd( aThought );
325  // Once the goose arrives at a forage location it needs to add itself to the geese already there, or initiate a forage location if one does not exist
328  else {
329  g_msg->Warn( "TTypeOfGoose_BaseState Goose_Base::st_ChooseForageLocation() : No geese at foraging location when following", "" );
330  exit( 0 );
331  }
332  // some stats recording
334  m_myMemPolyID = aThought.m_polygonid;
335  return togs_Forage;
336  }
337  }
345  if (m_LeavingRoost) Explore(); // Go for an exploration trip to initialise the memory.
347  if (aThought.m_score<=0)
348  {
349  Explore(); // Go for an exploration trip
350  aThought = m_MyMemory->GetBestFeedingScore();
351  // Did we find anything suitable?:
352  if (aThought.m_score <= 0) {
353  // if not, start this method over again.
355  }
356  }
357  m_Location_x = aThought.m_x;
358  m_Location_y = aThought.m_y;
360  double grazing = m_OurLandscape->GetActualGooseGrazingForage(polyref, m_myspecies); // kJ/min
361  double grain = m_OurLandscape->SupplyBirdSeedForage(polyref); // kJ/m2
362  double maize = m_OurLandscape->SupplyBirdMaizeForage(polyref); // kJ/m2
363  bool instubble = m_OurLandscape->SupplyInStubble(polyref);
365  TTypesOfVegetation lastsowncrop = m_OurLandscape->SupplyLastSownVeg(polyref);
366  bool iscereal = m_OurLandscape->SupplyIsCereal2(lastsowncrop);
367  // Here we make a test to see if the forage location is in use before going further
369  // Here we do the forage calculation.The intake rate depends on :
370  // -1 The grain or grazing resource available in grain and grazing
371  double grain_intake = m_OurPopulationManager->GetFeedingRate(grain, m_myspecies); // kJ/min
372  double maize_intake = m_OurPopulationManager->GetMaizeFeedingRate(maize, m_myspecies); // kJ/min
373  m_MyMemory->ChangeSetFoodRes(aThought.m_polygonid, grain_intake, maize_intake, grazing); // Remember these
374 // -2 The relationship between resource and intake rate.This is dependent on the species and family or non - breeder. It also depends on the
375  // type of resource, i.e. the response for grain is different than for grazing.
376  // -3 The number of geese which will determine an interference competition factor, which reduces intake rate
377  double geese = m_groupsize; // if m_myForageIndex = -1, nobody else is there.
379  // -4 The interference factor is a look-up from a pre-calculated curve in the goose population manager
380  double interferenceComp = m_OurPopulationManager->GetForageRateDensity(geese);
381  // A simplification here is to assume that they either eat grain or graze but not both
382  double myforagerate;
383  myforagerate = GetMaxForageRate( grain_intake, maize_intake, grazing, interferenceComp, iscereal, veg, instubble, lastsowncrop); // GetMaxForageRate determines the source of max intake rate and adjust intake for snow cover if needed.
384  // Now decide if this is OK or not. The intake rate is compared to the current minimum intake rate for the individual.
385  if (myforagerate < m_Indivmingooseforagerate)
386  {
387  m_myForageIndex = -1; // If we don't do this we will get a negative number of geese on the forage location later unless they find somewhere else to go.
389  }
390  // OK we are staying
392  if (m_myForageIndex != -1){
394  }
395  else {
397  }
398  m_myMemPolyID = aThought.m_polygonid;
399  return togs_Forage;
400 }
boost::variate_generator< base_generator_type &, boost::uniform_int<> > g_rand_uni2
A random number generator (0-9999)
MapErrorMsg * g_msg
This pointer provides access the to the internal ALMaSS error message system.
Definition: maperrormsg.cpp:41
CfgInt cfg_goose_AfterDarkTime
The number of minutes that geese will be foraging after sunset.
@ togs_ChooseForageLocation
Definition: Goose_Base.h:77
@ togs_Forage
Definition: Goose_Base.h:78
@ togs_ToRoost
Definition: Goose_Base.h:79
A class to describe the goose base.
Definition: Goose_Base.h:132
int m_myMemPolyID
Temporary storage for a memory location polygon id.
Definition: Goose_Base.h:295
int GetForageLocIndex()
Gets for the forage location index.
Definition: Goose_Base.h:418
double GetMaxForageRate(double a_grain, double a_maize, double a_grass, double a_interferenceComp, bool a_iscereal, TTypesOfVegetation a_veg, bool a_stubble, TTypesOfVegetation a_prevcrop)
Returns the max forage rate of the three different types of forage The max rate is adjusted according...
Definition: Goose_Base.h:489
void Set_GooseLeavingRoost(bool a_leaving)
Set the flag to indicate if we are coming from the roost.
Definition: Goose_Base.h:636
void Explore()
Behavioural exploration of the area to find forage.
Definition: Goose_Base.cpp:571
int GetForageLocIndex(GooseSpecies a_species, int a_x, int a_y)
Get a forage location for my species (picked randomly among the active locations)
Definition: Goose_Population_Manager.cpp:2039
double GetForageGooseDensity(int a_index)
Returns the total goose density for a forage location.
Definition: Goose_Population_Manager.h:492
void AddGeeseToForageLocation(GooseSpeciesType a_type, int a_index, int a_number)
Adds a goose or geese to the forage location - requires an index.
Definition: Goose_Population_Manager.cpp:1806
double GetForageRateDensity(double a_foragedensity)
Get the forage intake rate for a forage density.
Definition: Goose_Population_Manager.h:488
GooseActiveForageLocation * GetForageLocation(unsigned int a_index)
Returns a pointer to the forage location indexed by index.
Definition: Goose_Population_Manager.h:448
int ForageLocationInUse(int a_polyref)
Tests if a forage location is currently in use, if so returns the index to it.
Definition: Goose_Population_Manager.cpp:1752
int GetBirdsAtForageLoc(int a_index, GooseSpeciesType a_type)
Returns the number of birds at a forage location - given by a poly ref.
Definition: Goose_Population_Manager.h:530
int GetDayTime()
Get the time of day (in minutes). For the goose model, sunrise is defined as m_daytime == 0....
Definition: Goose_Population_Manager.h:408
void RecordState()
Record the state.
Definition: Goose_Population_Manager.cpp:2272
Goose_Base * GetLeader(APoint a_homeloc, GooseSpecies a_species)
Asks for a pointer to a goose that can be followed.
Definition: Goose_Population_Manager.cpp:1989
int NewForageLocation(GooseSpeciesType a_type, int a_number, int a_polyref)
Creates a new forage location and adds a goose or geese to the forage location. Returns an index to t...
Definition: Goose_Population_Manager.cpp:1773
A class to hold an active goose foraging location and the number of birds of different types there.
Definition: Goose_Population_Manager.h:104
double GetGrainDensity(void)
Returns the current forage density (grain/m2)
Definition: Goose_Population_Manager.h:303
int GetPolygonref()
Get the landscape element ( LE ) reference number used by the Landscape class to identify this locati...
Definition: Goose_Population_Manager.h:190
double GetGrazing(int gs)
Returns the current forage rate kJ/min assuming no other geese affect this.
Definition: Goose_Population_Manager.h:334
double GetMaizeDensity(void)
Returns the current maize forage density (kJ/m2)
Definition: Goose_Population_Manager.h:313
bool ChangeSetFoodRes(int a_polyid, double a_grain, double a_maize, double a_grazing)
Set food at a memory location.
Definition: GooseMemoryMap.cpp:159
GooseMemoryLocation GetBestFeedingScore()
Find the current best feeding location.
Definition: GooseMemoryMap.cpp:236
bool IsKnownArea(int a_polyid)
Check if this location is known.
Definition: GooseMemoryMap.cpp:282
APoint SupplyCentroid(int a_polyref)
Definition: Landscape.cpp:766
bool SupplyInStubble(int a_polyref)
Returns whether its cereal.
Definition: landscape.h:634
TTypesOfVegetation SupplyLastSownVeg(int a_polyref)
Definition: landscape.h:1068
bool SupplyIsCereal2(TTypesOfVegetation a_vege_type)
Definition: Landscape.cpp:532
TTypesOfVegetation SupplyVegType(int a_x, int a_y)
Definition: landscape.h:1321
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: maperrormsg.cpp:59
TTypesOfVegetation
Definition: tov_declaration.h:30

References Goose_Population_Manager::AddGeeseToForageLocation(), ALMaSS_MathFuncs::CalcDistPythagorasApprox(), GooseMemoryMap::CalcScore(), cfg_goose_AfterDarkTime, GooseMemoryMap::ChangeSetFoodRes(), Explore(), FlyTo(), Goose_Population_Manager::ForageLocationInUse(), g_AlmassMathFuncs, g_msg, g_rand_uni2, Landscape::GetActualGooseGrazingForage(), GooseMemoryMap::GetBestFeedingScore(), Goose_Population_Manager::GetBirdsAtForageLoc(), Goose_Population_Manager::GetDayTime(), Goose_Population_Manager::GetFeedingRate(), Goose_Population_Manager::GetForageGooseDensity(), Goose_Population_Manager::GetForageLocation(), GetForageLocIndex(), Goose_Population_Manager::GetForageLocIndex(), Goose_Population_Manager::GetForageRateDensity(), GooseActiveForageLocation::GetGrainDensity(), GooseActiveForageLocation::GetGrazing(), Goose_Population_Manager::GetLeader(), GooseActiveForageLocation::GetMaizeDensity(), Goose_Population_Manager::GetMaizeFeedingRate(), GetMaxForageRate(), GetMaxIntakeRate(), GooseActiveForageLocation::GetPolygonref(), GooseMemoryMap::IsKnownArea(), m_followinglikelyhood, GooseMemoryLocation::m_foodresource, m_forageLocCount, GooseMemoryLocation::m_grain, GooseMemoryLocation::m_grazing, m_groupsize, m_Indivmingooseforagerate, m_LeavingRoost, TAnimal::m_Location_x, TAnimal::m_Location_y, GooseMemoryLocation::m_maize, m_myForageIndex, m_myGooseSpeciesType, m_MyMemory, m_myMemPolyID, m_MyRoost, m_myspecies, TAnimal::m_OurLandscape, m_OurPopulationManager, GooseMemoryLocation::m_polygonid, GooseMemoryLocation::m_score, GooseMemoryLocation::m_threat, APoint::m_x, GooseMemoryLocation::m_x, APoint::m_y, GooseMemoryLocation::m_y, GooseMemoryMap::MemAdd(), Goose_Population_Manager::NewForageLocation(), Goose_Population_Manager::RecordState(), Set_GooseLeavingRoost(), Landscape::SupplyBirdMaizeForage(), Landscape::SupplyBirdSeedForage(), Landscape::SupplyCentroid(), Landscape::SupplyCentroidX(), Landscape::SupplyCentroidY(), Landscape::SupplyDayInYear(), Landscape::SupplyDaylength(), Landscape::SupplyInStubble(), Landscape::SupplyIsCereal2(), Landscape::SupplyLastSownVeg(), Landscape::SupplyPolyRef(), Landscape::SupplyVegType(), togs_ChooseForageLocation, togs_Forage, togs_ToRoost, CfgInt::value(), and MapErrorMsg::Warn().

Referenced by On_Bang(), Goose_Barnacle_FamilyGroup::Step(), Goose_Barnacle_NonBreeder::Step(), Goose_Greylag_FamilyGroup::Step(), Goose_Greylag_NonBreeder::Step(), Goose_Pinkfoot_FamilyGroup::Step(), and Goose_Pinkfoot_NonBreeder::Step().

◆ st_Dying()

void Goose_Base::st_Dying ( void  )

Behavioural state dying.

252 {
253  m_CurrentStateNo = -1; // this will kill the animal object and free up space
254  m_StepDone = true;
255  delete m_MyMemory; // this is reinitisalised in the object pool.
256 }
bool m_StepDone
Indicates whether the iterative step code is done for this timestep.
Definition: PopulationManager.h:118

References TALMaSSObject::m_CurrentStateNo, m_MyMemory, and TALMaSSObject::m_StepDone.

Referenced by Goose_Barnacle_FamilyGroup::Step(), Goose_Barnacle_NonBreeder::Step(), Goose_Greylag_FamilyGroup::Step(), Goose_Greylag_NonBreeder::Step(), Goose_Pinkfoot_FamilyGroup::Step(), and Goose_Pinkfoot_NonBreeder::Step().

◆ st_Forage()

TTypeOfGoose_BaseState Goose_Base::st_Forage ( )

Behavioural forage.

Must assess the competition status here (must be at a forage location to call this state). If the forage rate resulting from competition and forage availability is too low then the bird will move the flock/family, otherwise it will signal feeding at a certain rate. The forage loss will need to be calculated and sent to the LE polygon (foragae location) in question. This is done immediately since it will influence the forage assessment of birds not yet considered in this step (assumed to come later).

The first things is to check if we are near the end of daylight, if so then fly to roost.

If the goose has eaten all it can in a day, then it just rests on the field until evening.
Get the grain and forage density - NB is in KJ, which needs to be to needs to be remembered.
Here we do the forage calculation.The intake rate depends on : -1 The grain or grazing resource available -2 The relationship between resource and intake rate.This is dependent on the species and family or non - breeder. It also depends on the type of resource, i.e. the response for grain is different than for grazing. -3 The number of geese which will determine an interference competition factor, which reduces intake rate

Then decide if this is OK or not. The simplest here is to compare to a standard intake rate threshold for the species/type combination.

If can't get our required forage rate then try to find somewhere that we can, and if we find a place that cannot meet our requirements then we want to forget this place fast.

No food here, so lower the acceptable level of MFR

If the goose decides to move on immediately then it must deregister itself or group with the population manager at this forage location. This is done by using RemoveGeeseFromForageLocation

If OK then how long should we feed?
There are three constraints:

  • End of day
  • Crop full
  • Energy reserves a maximum
434 {
456  int dtime = m_OurPopulationManager->GetDayTime();
457  int daylength = m_OurLandscape->SupplyDaylength();
458  if (dtime >= daylength + cfg_goose_AfterDarkTime.value())
459  {
460 #ifdef __DEBUG_GOOSE
461  if (m_myForageIndex != -1)
462  {
464  g_msg->Warn("Goose_Base::st_Forage - Removing negative geese from forage location", (double)(m_OurPopulationManager->GetBirdsAtForageLoc(m_myForageIndex, m_myGooseSpeciesType) - m_groupsize));
465  exit(0);
466  }
467  }
468 #endif
469  return togs_ToRoost;
470  }
472  {
473  if (m_DailyMaxAppetiteHitTime > dtime) {
475  }
476  return togs_Forage;
477  }
478  //
479  // Get the grain and forage density - NB grain/m2 and maize in kJ/m2, which needs to be to needs to be remembered.
480  //
481  int polyref = m_OurPopulationManager->m_GooseForageLocations[m_myForageIndex].GetPolygonref();
482  double grazing = m_OurLandscape->GetActualGooseGrazingForage(polyref, m_myspecies); // kJ/min
483  double grain = m_OurLandscape->SupplyBirdSeedForage(polyref); // kJ/m2
484  double maize = m_OurLandscape->SupplyBirdMaizeForage(polyref); // kJ/m2
485  bool instubble = m_OurLandscape->SupplyInStubble(polyref);
487  TTypesOfVegetation lastsowncrop = m_OurLandscape->SupplyLastSownVeg(polyref);
488  bool iscereal = m_OurLandscape->SupplyIsCereal2(lastsowncrop);
489  // Here we do the forage calculation.The intake rate depends on :
490  // -1 The grain, maize or grazing resource available in grain, maize and grazing
491  double grain_intake = m_OurPopulationManager->GetFeedingRate( grain, m_myspecies ); // KJ/min
492  double maize_intake = m_OurPopulationManager->GetMaizeFeedingRate(maize, m_myspecies); // KJ/min
493  m_MyMemory->ChangeSetFoodRes(m_myMemPolyID, grain_intake, maize_intake, grazing); // Remember these
494  // -2 The relationship between resource and intake rate. This is dependent on the species and family or non-breeder. It also depends on the
495  // type of resource, i.e. the response for grain or maize is different than for grazing.
496  // -3 The number of geese which will determine an interference competition factor, which reduces intake rate
498  // -4 The interfence factor is a look-up from a pre-calculated curve in the goose population manager
499  double interferenceComp = m_OurPopulationManager->GetForageRateDensity(geese);
500  // A simplification here is to assume that they either eat grain, maize or graze but any combination
501  double myforagerate;
502  myforagerate = GetMaxForageRate( grain_intake, maize_intake, grazing, interferenceComp, iscereal, veg, instubble, lastsowncrop); // GetMaxForageRate determines the source of max intake rate and adjust intake for snow cover if needed.
503  // Now decide if this is OK or not. The simplest here is to compare to a standard intake rate threshold for the species/type combination.
504  if (myforagerate < m_Indivmingooseforagerate)
505  {
513 
519  m_myForageIndex = -1;
521  }
529  // We have lots of food, stay and eat until full.
530  double forage = myforagerate * 10; // 10 for 10 minutes
531  m_energyToday += forage;
532  // Scale the amount of forage removed from the field to the size of the group (1 for non-breeders)
533  forage = ScaleForageToGroupsize(forage);
535  if (dtime >= daylength + cfg_goose_AfterDarkTime.value())
536  {
537  Set_Indivmingooseforagerate( GetGooseMinForageRate(m_myspecies) ); // Okay, we found food today, so reset the minimum acceptable MFR.
538  return togs_ToRoost;
539  }
540  return togs_Forage;
541 }
CfgFloat cfg_goose_MinForageRateDecayRate
The decay rate for the minimum forage rate.
double ScaleForageToGroupsize(double a_forage)
Scales forage to groupsize.
Definition: Goose_Base.h:414
double GetGooseMinForageRate(GooseSpecies a_species)
Returns the minimum forage rate for the species.
Definition: Goose_Base.h:471
std::vector< GooseActiveForageLocation > m_GooseForageLocations
Is a list of active goose forage locations where we have geese.
Definition: Goose_Population_Manager.h:558
void RemoveMaxForageKj(double a_forage, TTypeOfMaxIntakeSource a_maxintakesource, int m_myForageIndex)
Removes the forage eaten from the field.
Definition: Goose_Population_Manager.cpp:2073
bool MemDel(int a_polyid)
Delete a memory location.
Definition: GooseMemoryMap.cpp:87

References cfg_goose_AfterDarkTime, cfg_goose_MinForageRateDecayRate, GooseMemoryMap::ChangeSetFoodRes(), g_msg, Landscape::GetActualGooseGrazingForage(), Goose_Population_Manager::GetBirdsAtForageLoc(), Goose_Population_Manager::GetDayTime(), Goose_Population_Manager::GetFeedingRate(), Goose_Population_Manager::GetForageGooseDensity(), Goose_Population_Manager::GetForageRateDensity(), GetGooseMinForageRate(), Goose_Population_Manager::GetMaizeFeedingRate(), GetMaxForageRate(), m_DailyMaxAppetite, m_DailyMaxAppetiteHitTime, m_energyToday, Goose_Population_Manager::m_GooseForageLocations, m_groupsize, m_Indivmingooseforagerate, TMaxIntakeSource::m_maxintakesource, m_MaxIntakeSource, m_myForageIndex, m_myGooseSpeciesType, m_MyMemory, m_myMemPolyID, m_myspecies, TAnimal::m_OurLandscape, m_OurPopulationManager, GooseMemoryMap::MemDel(), Goose_Population_Manager::RemoveGeeseFromForageLocation(), Goose_Population_Manager::RemoveMaxForageKj(), ScaleForageToGroupsize(), Set_Indivmingooseforagerate(), Landscape::SupplyBirdMaizeForage(), Landscape::SupplyBirdSeedForage(), Landscape::SupplyDaylength(), Landscape::SupplyInStubble(), Landscape::SupplyIsCereal2(), Landscape::SupplyLastSownVeg(), Landscape::SupplyVegType(), togs_ChooseForageLocation, togs_Forage, togs_ToRoost, CfgInt::value(), CfgFloat::value(), and MapErrorMsg::Warn().

Referenced by Goose_Barnacle_FamilyGroup::Step(), Goose_Barnacle_NonBreeder::Step(), Goose_Greylag_FamilyGroup::Step(), Goose_Greylag_NonBreeder::Step(), Goose_Pinkfoot_FamilyGroup::Step(), and Goose_Pinkfoot_NonBreeder::Step().

◆ st_Roost()

TTypeOfGoose_BaseState Goose_Base::st_Roost ( )

Roosting until next forage or next morning.

Assesses whether it is daylight and time to leave the roost. If not it continues to roost.

m_LeaveRoostTime is a way to stagger the birds leaving the roost. Each birds has its own leave time set each day.

551 {
556  {
557  return togs_Roost;
558  }
563  {
564  return togs_Roost;
565  }
566  Set_GooseLeavingRoost( true ); // Indicate that we are coming from the roost. Used to trigger memory initialisation via explore.
568 }
@ togs_Roost
Definition: Goose_Base.h:80
int GetIsDaylight()
Is it daylight hours? Daylight starts at m_daytime == 0.
Definition: Goose_Population_Manager.h:416

References Goose_Population_Manager::GetDayTime(), Goose_Population_Manager::GetIsDaylight(), m_LeaveRoostTime, m_OurPopulationManager, Set_GooseLeavingRoost(), togs_ChooseForageLocation, and togs_Roost.

Referenced by Goose_Barnacle_FamilyGroup::Step(), Goose_Barnacle_NonBreeder::Step(), Goose_Greylag_FamilyGroup::Step(), Goose_Greylag_NonBreeder::Step(), Goose_Pinkfoot_FamilyGroup::Step(), and Goose_Pinkfoot_NonBreeder::Step().

◆ st_ToRoost()

TTypeOfGoose_BaseState Goose_Base::st_ToRoost ( )
virtual

Return to roost and assess whether to forage again that day.

Reimplemented in Goose_Pinkfoot_Base, Goose_Greylag_Base, and Goose_Barnacle_Base.

545 {
546  return togs_foobar;
547 }
@ togs_foobar
Definition: Goose_Base.h:83

References togs_foobar.

◆ StartDay()

void Goose_Base::StartDay ( void  )
virtual

Do any 'housekeeping' associated with the start of day.

182 {
183  // Adjust the energy reserves
184  if (m_OurPopulationManager->GetDayTime() == 0)
185  {
186  // Remove our DEB from our net energy collection for the day
187  m_energyToday -= m_DEB;
188  if (m_energyToday > 0)
189  {
191  }
193 
195  if (m_weightTotal < m_weight) {
197  }
198  // Some goose output recording
206  m_forageLocCount = 0;
207 
208  // Set the body condition as % by weight of fat. This is a running sum over the last 5 days.
211  double condition = m_weightTotal / m_weight;
214  // Here we limit the maximum growth possible
217  }
219  {
221  }
222  // Reset energy intake
223  m_energyToday = 0;
224  m_FlightNumber = 0;
225  m_FlightDistance = 0;
226  // Reset the roost leaving time
228  // Reset the time when m_DailyMaxAppetite was hit. If reaching dailymaxappetite takes less than a whole day, the time is recorded. Therefore we "reset" to 1440, not 0.
230  // Decay all memories before adding new information today
232  // Calculate the new DEB
233  double daylightprop = m_OurLandscape->SupplyDaylightProp();
234  double nighttimeprop = m_OurLandscape->SupplyNightProp();
235  double multiplier = cfg_goose_daytime_BMR_multiplier.value() * daylightprop + cfg_goose_nighttime_BMR_multiplier.value() * nighttimeprop;
237  double minforagerate = (m_DEB / (1440 * daylightprop)); // They accept forage rates so they can optain positive energy balance
238  Set_mingooseforagerate( minforagerate, m_myspecies );
239  Set_Indivmingooseforagerate( minforagerate ); // At the start of the day, give the individual the MFR for the species
240  m_SnowDepth = m_OurLandscape->SupplySnowDepth(); // We store the current snow depth here for speed optimization.
241  }
242 }
CfgFloat cfg_goose_daytime_BMR_multiplier
To calculate daily energy budget. This is the multiple of BMR spent during daytime Default is based o...
CfgFloat cfg_goose_nighttime_BMR_multiplier
To calculate daily energy budget. This is the multiple of BMR spent during nighttime.
@ tolr_leanweight
Definition: Goose_Base.h:106
@ tolr_bodycondition
Definition: Goose_Base.h:105
void On_Migrate(TTypeOfLeaveReason a_leavereason)
The goose is told to leave the simulation area (poss due to bad weather)
Definition: Goose_Base.cpp:722
void SubtractBodyCondition(double a_condition)
Alters body conditon by subtraction of a double value.
Definition: Goose_Base.h:406
int GetForagingTime(int a_EndForagingTime, double a_RoostLeaveTime)
Returns the time spent foraging.
Definition: Goose_Base.cpp:738
void Set_mingooseforagerate(double a_cost, GooseSpecies a_species)
Set the mimimum tolerated forage rate for all geese.
Definition: Goose_Base.h:574
double GetThermalCosts(GooseSpecies a_goose)
Get daily thermal costs const.
Definition: Goose_Population_Manager.h:556
void RecordWeight(double a_weight, GooseSpecies a_species)
Record the weight.
Definition: Goose_Population_Manager.cpp:2164
void RecordFlightDistance(int a_distance, GooseSpecies a_species)
Record the flight distance.
Definition: Goose_Population_Manager.cpp:2217
void RecordForagingTime(int a_time, GooseSpecies a_species)
Record the time spent foraging.
Definition: Goose_Population_Manager.cpp:2203
Variate_gen * m_variate_generator
Function to be able to draw randomly from predefined distributions.
Definition: Goose_Population_Manager.h:564
void RecordIndForageLoc(double a_count, int a_groupsize, GooseSpecies a_species)
Record a forage location count.
Definition: Goose_Population_Manager.cpp:2259
void RecordDailyEnergyBudget(int a_deb, GooseSpecies a_species)
Record the daily energy budget.
Definition: Goose_Population_Manager.cpp:2231
void RecordDailyEnergyBalance(int a_balance, GooseSpecies a_species)
Record the daily energy balance.
Definition: Goose_Population_Manager.cpp:2245
void DecayAllMemory()
Decay all memory.
Definition: GooseMemoryMap.cpp:295
double SupplyDaylightProp()
Definition: landscape.h:825
double SupplySnowDepth(void)
Definition: landscape.h:1444
double SupplyNightProp()
Definition: landscape.h:826

References AddBodyCondition(), cfg_goose_daytime_BMR_multiplier, cfg_goose_nighttime_BMR_multiplier, GooseMemoryMap::DecayAllMemory(), Goose_Population_Manager::GetDayTime(), GetForagingTime(), Goose_Population_Manager::GetThermalCosts(), m_BMR, m_BodyCondition, m_BodyConditionCounter, m_DailyMaxAppetiteHitTime, m_DEB, m_energyReserve, m_energyToday, m_FlightDistance, m_FlightNumber, m_forageLocCount, m_GooseFattoKJConversion, m_GooseKJtoFatConversion, m_GooseLeavingThreshold, m_GooseMaxEnergyReserveProportion, m_groupsize, m_LeaveRoostTime, m_MyMemory, m_myspecies, TAnimal::m_OurLandscape, m_OurPopulationManager, m_SnowDepth, m_TheBodyCondition, Goose_Population_Manager::m_variate_generator, m_weight, m_weightTotal, On_Migrate(), Goose_Population_Manager::RecordDailyEnergyBalance(), Goose_Population_Manager::RecordDailyEnergyBudget(), Goose_Population_Manager::RecordFlightDistance(), Goose_Population_Manager::RecordForagingTime(), Goose_Population_Manager::RecordIndForageLoc(), Goose_Population_Manager::RecordWeight(), Set_Indivmingooseforagerate(), Set_mingooseforagerate(), SetBodyCondition(), SubtractBodyCondition(), Landscape::SupplyDaylightProp(), Landscape::SupplyNightProp(), Landscape::SupplySnowDepth(), tolr_bodycondition, tolr_leanweight, and CfgFloat::value().

Referenced by BeginStep().

◆ Step()

void Goose_Base::Step ( void  )
virtual

The Step is the second 'part' of the timestep that an animal can behave in. It is called continuously until all animals report that they are 'DONE'.

Reimplemented from TAnimal.

Reimplemented in Goose_Pinkfoot_NonBreeder, Goose_Pinkfoot_FamilyGroup, Goose_Greylag_NonBreeder, Goose_Greylag_FamilyGroup, Goose_Barnacle_NonBreeder, and Goose_Barnacle_FamilyGroup.

245 {
246  m_OurLandscape->Warn("Goose_Base::Step()","attempt to instantiate and use the base class!");
247  exit(1);
248 }

References TAnimal::m_OurLandscape, and Landscape::Warn().

◆ SubtractBodyCondition()

void Goose_Base::SubtractBodyCondition ( double  a_condition)
inline

Alters body conditon by subtraction of a double value.

406 { m_TheBodyCondition -= a_condition; }

References m_TheBodyCondition.

Referenced by StartDay().

Member Data Documentation

◆ CurrentGState

TTypeOfGoose_BaseState Goose_Base::CurrentGState
protected

Variable to record current behavioural state.

A Goose_Base must have some simple functionality: Inititation Movement Dying

Inherits m_Location_x, m_Location_y, m_OurLandscape from TAnimal NB All areas are squares of size length X length

Referenced by On_Bang(), On_Emigrate(), On_Migrate(), Goose_Barnacle_FamilyGroup::Step(), Goose_Barnacle_NonBreeder::Step(), Goose_Greylag_FamilyGroup::Step(), Goose_Greylag_NonBreeder::Step(), Goose_Pinkfoot_FamilyGroup::Step(), and Goose_Pinkfoot_NonBreeder::Step().

◆ m_BMR

double Goose_Base::m_BMR
protected

◆ m_BodyCondition

double Goose_Base::m_BodyCondition[5]
protected

A variable describing current body condition over the past 5 days.

Referenced by SetBodyCondition(), and StartDay().

◆ m_BodyConditionCounter

unsigned Goose_Base::m_BodyConditionCounter
protected

A counter for the daily body condition.

Referenced by StartDay().

◆ m_DailyMaxAppetite

double Goose_Base::m_DailyMaxAppetite
protected

The daily max kJ possible to get as intake.

Referenced by Goose_Barnacle_Base::Init(), Goose_Greylag_Base::Init(), Goose_Pinkfoot_Base::Init(), and st_Forage().

◆ m_DailyMaxAppetiteHitTime

int Goose_Base::m_DailyMaxAppetiteHitTime
protected

The time of day when m_DailyMaxAppetite was hit.

Referenced by GetMaxAppetiteHitTime(), st_Forage(), and StartDay().

◆ m_DEB

double Goose_Base::m_DEB
protected

The daily energy budget excluding flying (kJ)

Referenced by GetDailyEnergyBudget(), Goose_Barnacle_Base::Init(), Goose_Greylag_Base::Init(), Goose_Pinkfoot_Base::Init(), and StartDay().

◆ m_energyReserve

double Goose_Base::m_energyReserve
protected

The bird's energy reserves in grams.

Referenced by StartDay().

◆ m_energyToday

double Goose_Base::m_energyToday
protected

The bird's daily energy account (kJ)

Referenced by FlyTo(), GetDailyEnergyExpenditure(), st_Forage(), and StartDay().

◆ m_flightcost

double Goose_Base::m_flightcost = -1
staticprotected

The cost of flight per g per m in kJ.

but with correct values.

Referenced by GetFlightCost(), and SetFlightCost().

◆ m_FlightDistance

int Goose_Base::m_FlightDistance
protected

Storage for the total distance flown per day.

Referenced by FlyTo(), GetFlightDistance(), and StartDay().

◆ m_FlightNumber

int Goose_Base::m_FlightNumber
protected

Counter for the number of flights per day.

Referenced by FlyTo(), GetFlightNumber(), and StartDay().

◆ m_followinglikelyhood

int Goose_Base::m_followinglikelyhood = { -1, -1, -1 , -1, -1, -1 }
staticprotected

An attribute used to determine the chance of following or exploring when foraging.

Referenced by Set_GooseFollowingLikelyhood(), and st_ChooseForageLocation().

◆ m_forageLocCount

int Goose_Base::m_forageLocCount
protected

The number of forage locations visited today.

Referenced by st_ChooseForageLocation(), and StartDay().

◆ m_GooseFattoKJConversion

double Goose_Base::m_GooseFattoKJConversion = -1
staticprotected

Conversion rate fat to kJ.

Referenced by Set_GooseFattoKJConversion(), and StartDay().

◆ m_GooseFieldForageDist

double Goose_Base::m_GooseFieldForageDist = { -1, -1, -1 }
staticprotected

The maximum distance travelled from roost to forage sites for each species of goose (m)

Referenced by Goose_Barnacle_Base::ChooseHopLoc(), Goose_Pinkfoot_Base::ChooseHopLoc(), and Set_GooseFieldForageDist().

◆ m_GooseFieldForageDistX2

double Goose_Base::m_GooseFieldForageDistX2 = { -1, -1, -1 }
staticprotected

Double the maximum distance travelled from roost to forage sites for each species of goose (m) - this is a speed optimisation.

Referenced by Goose_Barnacle_Base::ChooseHopLoc(), Goose_Pinkfoot_Base::ChooseHopLoc(), and Set_GooseFieldForageDist().

◆ m_GooseForageDist

double Goose_Base::m_GooseForageDist = { -1, -1, -1 }
staticprotected

The maximum distance travelled from roost to forage sites for each species of goose (m)

Referenced by Goose_Barnacle_Base::ChooseHopLoc(), Goose_Greylag_Base::ChooseHopLoc(), Goose_Pinkfoot_Base::ChooseHopLoc(), and Set_GooseForageDist().

◆ m_GooseForageDistX2

double Goose_Base::m_GooseForageDistX2 = { -1, -1, -1 }
staticprotected

Double the maximum distance travelled from roost to forage sites for each species of goose (m) - this is a speed optimisation.

Referenced by Goose_Barnacle_Base::ChooseHopLoc(), Goose_Greylag_Base::ChooseHopLoc(), Goose_Pinkfoot_Base::ChooseHopLoc(), and Set_GooseForageDist().

◆ m_GooseKJtoFatConversion

double Goose_Base::m_GooseKJtoFatConversion = -1
staticprotected

Conversion rate kJ to fat.

Referenced by Set_GooseKJtoFatConversion(), and StartDay().

◆ m_GooseLeavingThreshold

double Goose_Base::m_GooseLeavingThreshold = -1
staticprotected

The trigger for leaving as a 5 day average of body condition.

Referenced by Set_GooseLeavingThreshold(), and StartDay().

◆ m_GooseMaxAppetiteScaler

double Goose_Base::m_GooseMaxAppetiteScaler = -1
staticprotected

Scaler to determine the max kJ possible to eat per day based on non-energy reserve weight.

Referenced by Goose_Barnacle_Base::Init(), Goose_Greylag_Base::Init(), Goose_Pinkfoot_Base::Init(), and Set_GooseMaxAppetiteScaler().

◆ m_GooseMaxEnergyReserveProportion

double Goose_Base::m_GooseMaxEnergyReserveProportion = -1
staticprotected

Max proportion of weight that can be energy reserve.

Referenced by Set_GooseMaxEnergyReserveProportion(), and StartDay().

◆ m_GooseMinForageOpenness

double Goose_Base::m_GooseMinForageOpenness = -1
staticprotected

The minimum openness value a goose will tolerate for forage.

Referenced by EvaluateForageToHopLoc(), and Set_GooseMinForageOpenness().

◆ m_groupsize

◆ m_Indivmingooseforagerate

double Goose_Base::m_Indivmingooseforagerate
protected

The minimum tolerable forage rate in kJ/minute for the individual.

Referenced by Set_Indivmingooseforagerate(), st_ChooseForageLocation(), and st_Forage().

◆ m_LeaveRoostTime

double Goose_Base::m_LeaveRoostTime
protected

Controls the time when the goose will leave the roost.

Referenced by GetRoostLeaveTime(), st_Roost(), and StartDay().

◆ m_LeavingRoost

bool Goose_Base::m_LeavingRoost
protected

Flag to indicate that we are coming from the roost. Used to control code for "following".

Referenced by Set_GooseLeavingRoost(), and st_ChooseForageLocation().

◆ m_MaxIntakeSource

TMaxIntakeSource Goose_Base::m_MaxIntakeSource
protected

Holds information about the food source which gave max intake rate.

Referenced by GetMaxForageRate(), GetMaxIntakeSource(), and st_Forage().

◆ m_mingooseforagerate

double Goose_Base::m_mingooseforagerate = { -1, -1, -1 }
staticprotected

The minimum tolerable forage rate in kJ/minute for the species.

Referenced by GetGooseMinForageRate(), and Set_mingooseforagerate().

◆ m_myForageIndex

◆ m_myGooseSpeciesType

◆ m_MyMemory

◆ m_myMemPolyID

int Goose_Base::m_myMemPolyID
protected

Temporary storage for a memory location polygon id.

Referenced by st_ChooseForageLocation(), and st_Forage().

◆ m_MyRoost

◆ m_myspecies

◆ m_OurPopulationManager

◆ m_sex

bool Goose_Base::m_sex
protected

Sex of bird, true = male false = female.

Referenced by GetSex(), and SetSex().

◆ m_SnowDepth

double Goose_Base::m_SnowDepth = 0.0
staticprotected

The current snow depth. Held here for speed optimization.

Referenced by AdjustIntakeRateToSnowDepth(), and StartDay().

◆ m_TheBodyCondition

double Goose_Base::m_TheBodyCondition
protected

A variable describing current body condition averaged over 5 days.

Referenced by AddBodyCondition(), GetBodyCondition(), StartDay(), and SubtractBodyCondition().

◆ m_weight

double Goose_Base::m_weight
protected

The weight of the bird in gram excluding fat reserve.

Referenced by StartDay().

◆ m_weightTotal

double Goose_Base::m_weightTotal
protected

The weight of the bird in g including fat reserve.

Referenced by GetFlightCost(), GetTotalWeight(), and StartDay().


The documentation for this class was generated from the following files: